<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend Framework 1.0 - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/migration.10.html">Inglês (English)</a></li>
    <li><a href="../pt-br/migration.10.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="migration.15.html">Zend Framework 1.5</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="migration.html">Notas de Migra&ccedil;&atilde;o do Zend Framework</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="migration.09.html">Zend Framework 0.9</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="migration.10" class="section"><div class="info"><h1 class="title">Zend Framework 1.0</h1></div>
    

    <p class="para">
        When upgrading from a previous release to Zend Framework 1.0 or higher you
        should note the following migration notes.
    </p>

    <div class="section" id="migration.10.zend.controller"><div class="info"><h1 class="title">Zend_Controller</h1></div>
        

        <p class="para">
            The principal changes introduced in 1.0.0RC1 are the introduction of
            and default enabling of the
            <a href="zend.controller.plugins.html#zend.controller.plugins.standard.errorhandler" class="link">ErrorHandler</a>
            plugin and the <a href="zend.controller.actionhelpers.html#zend.controller.actionhelpers.viewrenderer" class="link">ViewRenderer</a>
            action helper. Please read the documentation to each thoroughly to
            see how they work and what effect they may have on your
            applications.
        </p>

        <p class="para">
            The <span class="classname">ErrorHandler</span> plugin runs during
             <span class="methodname">postDispatch()</span> checking for exceptions, and forwarding
            to a specified error handler controller. You should include such a
            controller in your application. You may disable it by setting the
            front controller parameter <span class="property">noErrorHandler</span>:
        </p>

        <pre class="programlisting brush: php">
$front-&gt;setParam(&#039;noErrorHandler&#039;, true);
</pre>


        <p class="para">
            The <span class="classname">ViewRenderer</span> action helper automates view injection
            into action controllers as well as autorendering of view scripts
            based on the current action. The primary issue you may encounter is
            if you have actions that do not render view scripts and neither
            forward or redirect, as the <span class="classname">ViewRenderer</span> will attempt
            to render a view script based on the action name.
        </p>

        <p class="para">
            There are several strategies you can take to update your code. In
            the short term, you can globally disable the
            <span class="classname">ViewRenderer</span> in your front controller bootstrap prior
            to dispatching:
        </p>

        <pre class="programlisting brush: php">
// Assuming $front is an instance of Zend_Controller_Front
$front-&gt;setParam(&#039;noViewRenderer&#039;, true);
</pre>


        <p class="para">
            However, this is not a good long term strategy, as it means most
            likely you&#039;ll be writing more code.
        </p>

        <p class="para">
            When you&#039;re ready to start using the <span class="classname">ViewRenderer</span>
            functionality, there are several things to look for in your
            controller code. First, look at your action methods (the methods
            ending in &#039;Action&#039;), and determine what each is doing. If none of
            the following is happening, you&#039;ll need to make changes:
        </p>

        <ul class="itemizedlist">
            <li class="listitem"><p class="para">Calls to <strong class="command">$this-&gt;render();</strong></p></li>
            <li class="listitem"><p class="para">Calls to <strong class="command">$this-&gt;_forward();</strong></p></li>
            <li class="listitem"><p class="para">Calls to <strong class="command">$this-&gt;_redirect();</strong></p></li>

            <li class="listitem">
                <p class="para">Calls to the <span class="classname">Redirector</span> action helper</p>
            </li>
        </ul>

        <p class="para">
            The easiest change is to disable auto-rendering for that method:
        </p>

        <pre class="programlisting brush: php">
$this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender();
</pre>


        <p class="para">
            If you find that none of your action methods are rendering,
            forwarding, or redirecting, you will likely want to put the above
            line in your  <span class="methodname">preDispatch()</span> or  <span class="methodname">init()</span>
            methods:
        </p>

        <pre class="programlisting brush: php">
public function preDispatch()
{
    // disable view script autorendering
    $this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender()
    // .. do other things...
}
</pre>


        <p class="para">
            If you are calling  <span class="methodname">render()</span>, and you&#039;re using <a href="zend.controller.modular.html" class="link">the Conventional Modular
                directory structure</a>, you&#039;ll want to change your code to
            make use of autorendering:
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">
                    If you&#039;re rendering multiple view scripts in a single
                    action, you don&#039;t need to change a thing.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    If you&#039;re simply calling  <span class="methodname">render()</span> with no
                    arguments, you can remove such lines.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    If you&#039;re calling  <span class="methodname">render()</span> with arguments, and
                    not doing any processing afterwards or rendering multiple
                    view scripts, you can change these calls to read
                    <strong class="command">$this-&gt;_helper-&gt;viewRenderer();</strong>.
                </p>
            </li>
        </ul>

        <p class="para">
            If you&#039;re not using the conventional modular directory structure,
            there are a variety of methods for setting the view base path and
            script path specifications so that you can make use of the
            <span class="classname">ViewRenderer</span>. Please read the <a href="zend.controller.actionhelpers.html#zend.controller.actionhelpers.viewrenderer" class="link">ViewRenderer
                documentation</a> for information on these methods.
        </p>

        <p class="para">
            If you&#039;re using a view object from the registry, or customizing your
            view object, or using a different view implementation, you&#039;ll want
            to inject the <span class="classname">ViewRenderer</span> with this object. This can
            be done easily at any time.
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">
                    Prior to dispatching a front controller instance:
                </p>

                <pre class="programlisting brush: php">
// Assuming $view has already been defined
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
</pre>

            </li>

            <li class="listitem">
                <p class="para">
                    Any time during the bootstrap process:
                </p>

                <pre class="programlisting brush: php">
$viewRenderer =
    Zend_Controller_Action_HelperBroker::getStaticHelper(&#039;viewRenderer&#039;);
$viewRenderer-&gt;setView($view);
</pre>

            </li>
        </ul>

        <p class="para">
            There are many ways to modify the <span class="classname">ViewRenderer</span>,
            including setting a different view script to render, specifying
            replacements for all replaceable elements of a view script path
            (including the suffix), choosing a response named segment to
            utilize, and more. If you aren&#039;t using the conventional modular
            directory structure, you can even associate different path
            specifications with the <span class="classname">ViewRenderer</span>.
        </p>

        <p class="para">
            We encourage you to adapt your code to use the
            <span class="classname">ErrorHandler</span> and <span class="classname">ViewRenderer</span> as they are
            now core functionality.
        </p>
    </div>

    <div class="section" id="migration.10.zend.currency"><div class="info"><h1 class="title">Zend_Currency</h1></div>
        

        <p class="para">
            Creating an object of <span class="classname">Zend_Currency</span> has become simpler.
            You no longer have to give a script or set it to <b><tt>NULL</tt></b>. The optional
            script parameter is now an option which can be set through the
             <span class="methodname">setFormat()</span> method.
        </p>

        <pre class="programlisting brush: php">
$currency = new Zend_Currency($currency, $locale);
</pre>


        <p class="para">
            The  <span class="methodname">setFormat()</span> method takes now an array of options. These
            options are set permanently and override all previously set values. Also a new option
            &#039;precision&#039; has been added. The following options have been refactored:
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">
                    <em class="emphasis">position</em>:
                    Replacement for the old &#039;rules&#039; parameter.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">script</em>:
                    Replacement for the old &#039;script&#039; parameter.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">format</em>:
                    Replacement for the old &#039;locale&#039; parameter which does not
                    set new currencies but only the number format.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">display</em>:
                    Replacement for the old &#039;rules&#039; parameter.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">precision</em>:
                    New parameter.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">name</em>:
                    Replacement for the ole &#039;rules&#039; parameter. Sets the full
                    currencies name.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">currency</em>:
                    New parameter.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <em class="emphasis">symbol</em>:
                    New parameter.
                </p>
            </li>
        </ul>

        <pre class="programlisting brush: php">
$currency-&gt;setFormat(array $options);
</pre>


        <p class="para">
            The  <span class="methodname">toCurrency()</span> method no longer supports the optional
            &#039;script&#039; and &#039;locale&#039; parameters. Instead it takes an options array which
            can contain the same keys as for the  <span class="methodname">setFormat()</span> method.
        </p>

        <pre class="programlisting brush: php">
$currency-&gt;toCurrency($value, array $options);
</pre>


        <p class="para">
            The methods  <span class="methodname">getSymbol()</span>,
             <span class="methodname">getShortName()</span>,  <span class="methodname">getName()</span>,
             <span class="methodname">getRegionList()</span> and
             <span class="methodname">getCurrencyList()</span> are no longer static and can be called
            from within the object. They return the set values of the object if no
            parameter has been set.
        </p>
    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="migration.15.html">Zend Framework 1.5</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="migration.html">Notas de Migra&ccedil;&atilde;o do Zend Framework</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="migration.09.html">Zend Framework 0.9</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="migration.html">Notas de Migra&ccedil;&atilde;o do Zend Framework</a></li>
  <li><a href="migration.110.html">Zend Framework 1.10</a></li>
  <li><a href="migration.19.html">Zend Framework 1.9</a></li>
  <li><a href="migration.18.html">Zend Framework 1.8</a></li>
  <li><a href="migration.17.html">Zend Framework 1.7</a></li>
  <li><a href="migration.16.html">Zend Framework 1.6</a></li>
  <li><a href="migration.15.html">Zend Framework 1.5</a></li>
  <li class="active"><a href="migration.10.html">Zend Framework 1.0</a></li>
  <li><a href="migration.09.html">Zend Framework 0.9</a></li>
  <li><a href="migration.08.html">Zend Framework 0.8</a></li>
  <li><a href="migration.06.html">Zend Framework 0.6</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>